//
//  LWNutWebViewController.m
//  LWShopItem
//
//  Created by mac on 17/3/28.
//  Copyright © 2017年 LWShop.com. All rights reserved.
//

#import "LWNutWebViewController.h"

@interface LWNutWebViewController ()

@property (weak,nonatomic) UIWebView *webView;

@end

@implementation LWNutWebViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setupUI];
}

#pragma mark- UI
- (void)setupUI
{
    self.view.backgroundColor = [UIColor whiteColor];
    
    CGFloat width = self.view.frame.size.width;
    CGFloat height = self.view.frame.size.height;
    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, width, height)];
    // 2.创建URL
    NSURL *url = [NSURL URLWithString:@"http://shop.sdlinwang.com"];
    // 3.创建Request
    NSURLRequest *request =[NSURLRequest requestWithURL:url];
    // 4.加载网页
    [webView loadRequest:request];
    // 5.最后将webView添加到界面
    [self.view addSubview:webView];
    
    self.webView = webView;
    
    UIButton *dismisBtn = [UIButton buttonWithType:UIButtonTypeInfoLight];
    [dismisBtn addTarget:self action:@selector(dismisClick) forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:dismisBtn];
}
#pragma MARK - 按钮的点击事件处理
- (void)dismisClick
{
    [self dismissViewControllerAnimated:YES completion:nil];
    
}

#pragma  MARK - 隐藏顶部状态栏
- (BOOL)prefersStatusBarHidden

{
    
    return YES;
    
}

@end
